Skip to content

fix(docker): build publishable image on python:3.13-slim#74

Merged
derek-palmer merged 3 commits into
mainfrom
fix/docker-publish-slim
May 29, 2026
Merged

fix(docker): build publishable image on python:3.13-slim#74
derek-palmer merged 3 commits into
mainfrom
fix/docker-publish-slim

Conversation

@derek-palmer
Copy link
Copy Markdown
Owner

Summary

The container image has never published — docker-publish failed on every tag because the Dockerfile built FROM dhi.io/python:3.13, a distroless base with no /bin/sh, so RUN pip install died with exec: "/bin/sh": ... no such file or directory.

Fix per #72:

  • Drop DHI/distroless, build multistage on python:3.13-slim (has a shell, pins 3.13, freely redistributable).
  • Builder installs the wheel into /opt/venv; runtime copies only the venv. Install . (not -e .) so package-data (prompts/**, tasks.json) is bundled and no source tree is needed at runtime.
  • /workspace stays a bind-mount point (forerunner runs against Path.cwd()).
  • Publish to Docker Hub heyderekp/codeforerunner + GHCR; DHI login removed; DOCKER_USERNAME/DOCKER_PASSWORD repurposed as Hub username + PAT.

Verification

  • docker build . succeeds (previously failed at the RUN step).
  • docker run --rm -v "$PWD:/workspace" <img> doctor runs against the mounted repo: 4 ok, 2 warn, 0 error.
  • docker compose build forerunner builds clean.

Human prerequisite before next tag

Create Hub repo heyderekp/codeforerunner, generate a Read/Write PAT, set repo secrets DOCKER_USERNAME=heyderekp and DOCKER_PASSWORD=<PAT>. Docker publish only runs on v*.*.* tags, so this can't be validated by PR CI.

Closes #72

🤖 Generated with Claude Code

The image never published: the Dockerfile built FROM dhi.io/python:3.13,
a distroless base with no /bin/sh, so `RUN pip install` died with
`exec: "/bin/sh": ... no such file or directory` on every tag.

Drop the hardened distroless base (it solved a network-service threat
model this CLI image doesn't have, can't pin Python 3.13, and
republishes licensed DHI layers to public registries). Build multistage
on python:3.13-slim: builder installs the wheel into a venv, runtime
copies only the venv. Install the wheel (not -e .) so package-data
(prompts, tasks.json) is bundled and no source tree is needed at
runtime. /workspace stays a bind-mount point for the caller's repo.

Publish to Docker Hub (heyderekp/codeforerunner) alongside GHCR; the
DHI registry login is gone. DOCKER_USERNAME/DOCKER_PASSWORD are
repurposed as Docker Hub username + PAT.

Closes #72
The workflow shape test asserted a dhi.io login, which encoded the
broken distroless setup. Assert the new targets instead: a ghcr.io
login, a Docker Hub login (default docker.io registry), no dhi.io, and
both image names in the metadata.

Refs #72
Comment thread tests/test_workflows_yaml.py Fixed
Comment thread tests/test_workflows_yaml.py Fixed
CodeQL py/incomplete-url-substring-sanitization fired on
`"ghcr.io" in <x>`. Compare login registries with == and match full
image refs against the parsed metadata-action images list instead.

Refs #72
@derek-palmer derek-palmer merged commit cf2fbd1 into main May 29, 2026
10 checks passed
@derek-palmer derek-palmer deleted the fix/docker-publish-slim branch May 29, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docker-publish never succeeds: distroless base has no /bin/sh

2 participants